<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3-3</title>
    <style type="text/css">
        body{text-align:center;}
        input{font:12px arial;cursor:pointer;padding:0 10px;}
    </style>
</head>
<body>
<input value="2" type="button">
<script type="text/javascript">
    window.onload = function(){
        var input = document.getElementsByTagName("input")[0];
        input.onclick = function(){
            this.value = ++this.value;
        };
    };
</script>
</body>
</html>